﻿CREATE TABLE [dbo].[ProductRatios] (
    [ID]         INT             IDENTITY (1, 1) NOT NULL,
    [ProductID]  INT             NOT NULL,
    [MaterialID] INT             NOT NULL,
    [Size]       VARCHAR (50)    NOT NULL,
    [Ratio]      DECIMAL (18, 8) NOT NULL,
    CONSTRAINT [PK_ProductRatios] PRIMARY KEY CLUSTERED ([ID] ASC),
    CONSTRAINT [FK_ProductRatios_ProductMaterials] FOREIGN KEY ([MaterialID]) REFERENCES [dbo].[ProductMaterials] ([ID]) ON DELETE CASCADE,
    CONSTRAINT [FK_ProductRatios_Products] FOREIGN KEY ([ProductID]) REFERENCES [dbo].[Products] ([ID]) ON DELETE CASCADE
);

